package com.pro.common.api.enums;

import com.pro.framework.api.enums.IEnumStr;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Schema(description = "登录入口")
@Getter
@AllArgsConstructor
public enum EnumLoginEntrance implements IEnumLoginEntrance, IEnumStr {
    ADMIN("超级后台一键登录", true),

    DEFAULT("默认入口", true),
    ;
    final String label;
    final Boolean isFullOpen;
    public static final Map<String, ? extends IEnumLoginEntrance> MAP = IEnumStr.getMap(values());


    public static List<IEnumLoginEntrance> getNotFullOpenList() {
        return Arrays.stream(values())
                .filter(e -> !Boolean.TRUE.equals(e.isFullOpen))
                .collect(Collectors.toList());
    }

}